using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Kinlo.Entitys
{
    /// <summary>喷码预充电池数据</summary>
    [Serializable]
    [DataObject]
    [Description("喷码预充电池数据")]
    [BindTable("Plate", Description = "喷码预充电池数据", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class Plate
    {
        #region 属性
        private Int64 _Id;
        /// <summary>雪花ID</summary>
        [DisplayName("雪花ID")]
        [Description("雪花ID")]
        [DataObjectField(true, false, false, 0)]
        [BindColumn("Id", "雪花ID", "")]
        public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }

        private DateTime _AcquisitionTime;
        /// <summary>数据获取时间</summary>
        [DisplayName("数据获取时间")]
        [Description("数据获取时间")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("Acquisition_Time", "数据获取时间", "")]
        public DateTime AcquisitionTime { get => _AcquisitionTime; set { if (OnPropertyChanging("AcquisitionTime", value)) { _AcquisitionTime = value; OnPropertyChanged("AcquisitionTime"); } } }

        private String _TrayBarcode;
        /// <summary>托盘码</summary>
        [DisplayName("托盘码")]
        [Description("托盘码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("TrayBarcode", "托盘码", "")]
        public String TrayBarcode { get => _TrayBarcode; set { if (OnPropertyChanging("TrayBarcode", value)) { _TrayBarcode = value; OnPropertyChanged("TrayBarcode"); } } }

        private String _CellType;
        /// <summary>电芯类型</summary>
        [DisplayName("电芯类型")]
        [Description("电芯类型")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CellType", "电芯类型", "")]
        public String CellType { get => _CellType; set { if (OnPropertyChanging("CellType", value)) { _CellType = value; OnPropertyChanged("CellType"); } } }

        private String _CellBatch;
        /// <summary>批次号</summary>
        [DisplayName("批次号")]
        [Description("批次号")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CellBatch", "批次号", "")]
        public String CellBatch { get => _CellBatch; set { if (OnPropertyChanging("CellBatch", value)) { _CellBatch = value; OnPropertyChanged("CellBatch"); } } }

        private Int64 _TrayID;
        /// <summary>托盘流水ID</summary>
        [DisplayName("托盘流水ID")]
        [Description("托盘流水ID")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TrayID", "托盘流水ID", "")]
        public Int64 TrayID { get => _TrayID; set { if (OnPropertyChanging("TrayID", value)) { _TrayID = value; OnPropertyChanged("TrayID"); } } }

        private String _TrayNo;
        /// <summary>托架号</summary>
        [DisplayName("托架号")]
        [Description("托架号")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("TrayNo", "托架号", "")]
        public String TrayNo { get => _TrayNo; set { if (OnPropertyChanging("TrayNo", value)) { _TrayNo = value; OnPropertyChanged("TrayNo"); } } }

        private Int32 _RowNo;
        /// <summary>行号</summary>
        [DisplayName("行号")]
        [Description("行号")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("RowNo", "行号", "")]
        public Int32 RowNo { get => _RowNo; set { if (OnPropertyChanging("RowNo", value)) { _RowNo = value; OnPropertyChanged("RowNo"); } } }

        private Int32 _ColNo;
        /// <summary>列号</summary>
        [DisplayName("列号")]
        [Description("列号")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("ColNo", "列号", "")]
        public Int32 ColNo { get => _ColNo; set { if (OnPropertyChanging("ColNo", value)) { _ColNo = value; OnPropertyChanged("ColNo"); } } }

        private Int32 _SeqNo;
        /// <summary>序号</summary>
        [DisplayName("序号")]
        [Description("序号")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("SeqNo", "序号", "")]
        public Int32 SeqNo { get => _SeqNo; set { if (OnPropertyChanging("SeqNo", value)) { _SeqNo = value; OnPropertyChanged("SeqNo"); } } }

        private String _Barcode;
        /// <summary>条码</summary>
        [DisplayName("条码")]
        [Description("条码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Barcode", "条码", "")]
        public String Barcode { get => _Barcode; set { if (OnPropertyChanging("Barcode", value)) { _Barcode = value; OnPropertyChanged("Barcode"); } } }

        private String _CCDResult;
        /// <summary>CCD拍照结果</summary>
        [DisplayName("CCD拍照结果")]
        [Description("CCD拍照结果")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CCDResult", "CCD拍照结果", "")]
        public String CCDResult { get => _CCDResult; set { if (OnPropertyChanging("CCDResult", value)) { _CCDResult = value; OnPropertyChanged("CCDResult"); } } }

        private String _CodeLong;
        /// <summary>二维码尺寸:长</summary>
        [DisplayName("二维码尺寸:长")]
        [Description("二维码尺寸:长")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CodeLong", "二维码尺寸:长", "")]
        public String CodeLong { get => _CodeLong; set { if (OnPropertyChanging("CodeLong", value)) { _CodeLong = value; OnPropertyChanged("CodeLong"); } } }

        private String _CodeWidth;
        /// <summary>二维码尺寸:宽</summary>
        [DisplayName("二维码尺寸:宽")]
        [Description("二维码尺寸:宽")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CodeWidth", "二维码尺寸:宽", "")]
        public String CodeWidth { get => _CodeWidth; set { if (OnPropertyChanging("CodeWidth", value)) { _CodeWidth = value; OnPropertyChanged("CodeWidth"); } } }

        private String _CodeHead;
        /// <summary>喷码距离头部距离</summary>
        [DisplayName("喷码距离头部距离")]
        [Description("喷码距离头部距离")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CodeHead", "喷码距离头部距离", "")]
        public String CodeHead { get => _CodeHead; set { if (OnPropertyChanging("CodeHead", value)) { _CodeHead = value; OnPropertyChanged("CodeHead"); } } }

        private String _CodeTail;
        /// <summary>喷码距离尾部距离</summary>
        [DisplayName("喷码距离尾部距离")]
        [Description("喷码距离尾部距离")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CodeTail", "喷码距离尾部距离", "")]
        public String CodeTail { get => _CodeTail; set { if (OnPropertyChanging("CodeTail", value)) { _CodeTail = value; OnPropertyChanged("CodeTail"); } } }

        private String _CodeTilt;
        /// <summary>喷码倾斜距离</summary>
        [DisplayName("喷码倾斜距离")]
        [Description("喷码倾斜距离")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("CodeTilt", "喷码倾斜距离", "")]
        public String CodeTilt { get => _CodeTilt; set { if (OnPropertyChanging("CodeTilt", value)) { _CodeTilt = value; OnPropertyChanged("CodeTilt"); } } }

        private Int32 _Status;
        /// <summary>状态</summary>
        [DisplayName("状态")]
        [Description("状态")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Status", "状态", "")]
        public Int32 Status { get => _Status; set { if (OnPropertyChanging("Status", value)) { _Status = value; OnPropertyChanged("Status"); } } }

        private DateTime _ProductDate;
        /// <summary>日期</summary>
        [DisplayName("日期")]
        [Description("日期")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("ProductDate", "日期", "")]
        public DateTime ProductDate { get => _ProductDate; set { if (OnPropertyChanging("ProductDate", value)) { _ProductDate = value; OnPropertyChanged("ProductDate"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "Id": return _Id;
                    case "AcquisitionTime": return _AcquisitionTime;
                    case "TrayBarcode": return _TrayBarcode;
                    case "CellType": return _CellType;
                    case "CellBatch": return _CellBatch;
                    case "TrayID": return _TrayID;
                    case "TrayNo": return _TrayNo;
                    case "RowNo": return _RowNo;
                    case "ColNo": return _ColNo;
                    case "SeqNo": return _SeqNo;
                    case "Barcode": return _Barcode;
                    case "CCDResult": return _CCDResult;
                    case "CodeLong": return _CodeLong;
                    case "CodeWidth": return _CodeWidth;
                    case "CodeHead": return _CodeHead;
                    case "CodeTail": return _CodeTail;
                    case "CodeTilt": return _CodeTilt;
                    case "Status": return _Status;
                    case "ProductDate": return _ProductDate;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "Id": _Id = value.ToLong(); break;
                    case "AcquisitionTime": _AcquisitionTime = value.ToDateTime(); break;
                    case "TrayBarcode": _TrayBarcode = Convert.ToString(value); break;
                    case "CellType": _CellType = Convert.ToString(value); break;
                    case "CellBatch": _CellBatch = Convert.ToString(value); break;
                    case "TrayID": _TrayID = value.ToLong(); break;
                    case "TrayNo": _TrayNo = Convert.ToString(value); break;
                    case "RowNo": _RowNo = value.ToInt(); break;
                    case "ColNo": _ColNo = value.ToInt(); break;
                    case "SeqNo": _SeqNo = value.ToInt(); break;
                    case "Barcode": _Barcode = Convert.ToString(value); break;
                    case "CCDResult": _CCDResult = Convert.ToString(value); break;
                    case "CodeLong": _CodeLong = Convert.ToString(value); break;
                    case "CodeWidth": _CodeWidth = Convert.ToString(value); break;
                    case "CodeHead": _CodeHead = Convert.ToString(value); break;
                    case "CodeTail": _CodeTail = Convert.ToString(value); break;
                    case "CodeTilt": _CodeTilt = Convert.ToString(value); break;
                    case "Status": _Status = value.ToInt(); break;
                    case "ProductDate": _ProductDate = value.ToDateTime(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得喷码预充电池数据字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>雪花ID</summary>
            public static readonly Field Id = FindByName("Id");

            /// <summary>数据获取时间</summary>
            public static readonly Field AcquisitionTime = FindByName("AcquisitionTime");

            /// <summary>托盘码</summary>
            public static readonly Field TrayBarcode = FindByName("TrayBarcode");

            /// <summary>电芯类型</summary>
            public static readonly Field CellType = FindByName("CellType");

            /// <summary>批次号</summary>
            public static readonly Field CellBatch = FindByName("CellBatch");

            /// <summary>托盘流水ID</summary>
            public static readonly Field TrayID = FindByName("TrayID");

            /// <summary>托架号</summary>
            public static readonly Field TrayNo = FindByName("TrayNo");

            /// <summary>行号</summary>
            public static readonly Field RowNo = FindByName("RowNo");

            /// <summary>列号</summary>
            public static readonly Field ColNo = FindByName("ColNo");

            /// <summary>序号</summary>
            public static readonly Field SeqNo = FindByName("SeqNo");

            /// <summary>条码</summary>
            public static readonly Field Barcode = FindByName("Barcode");

            /// <summary>CCD拍照结果</summary>
            public static readonly Field CCDResult = FindByName("CCDResult");

            /// <summary>二维码尺寸:长</summary>
            public static readonly Field CodeLong = FindByName("CodeLong");

            /// <summary>二维码尺寸:宽</summary>
            public static readonly Field CodeWidth = FindByName("CodeWidth");

            /// <summary>喷码距离头部距离</summary>
            public static readonly Field CodeHead = FindByName("CodeHead");

            /// <summary>喷码距离尾部距离</summary>
            public static readonly Field CodeTail = FindByName("CodeTail");

            /// <summary>喷码倾斜距离</summary>
            public static readonly Field CodeTilt = FindByName("CodeTilt");

            /// <summary>状态</summary>
            public static readonly Field Status = FindByName("Status");

            /// <summary>日期</summary>
            public static readonly Field ProductDate = FindByName("ProductDate");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得喷码预充电池数据字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>雪花ID</summary>
            public const String Id = "Id";

            /// <summary>数据获取时间</summary>
            public const String AcquisitionTime = "AcquisitionTime";

            /// <summary>托盘码</summary>
            public const String TrayBarcode = "TrayBarcode";

            /// <summary>电芯类型</summary>
            public const String CellType = "CellType";

            /// <summary>批次号</summary>
            public const String CellBatch = "CellBatch";

            /// <summary>托盘流水ID</summary>
            public const String TrayID = "TrayID";

            /// <summary>托架号</summary>
            public const String TrayNo = "TrayNo";

            /// <summary>行号</summary>
            public const String RowNo = "RowNo";

            /// <summary>列号</summary>
            public const String ColNo = "ColNo";

            /// <summary>序号</summary>
            public const String SeqNo = "SeqNo";

            /// <summary>条码</summary>
            public const String Barcode = "Barcode";

            /// <summary>CCD拍照结果</summary>
            public const String CCDResult = "CCDResult";

            /// <summary>二维码尺寸:长</summary>
            public const String CodeLong = "CodeLong";

            /// <summary>二维码尺寸:宽</summary>
            public const String CodeWidth = "CodeWidth";

            /// <summary>喷码距离头部距离</summary>
            public const String CodeHead = "CodeHead";

            /// <summary>喷码距离尾部距离</summary>
            public const String CodeTail = "CodeTail";

            /// <summary>喷码倾斜距离</summary>
            public const String CodeTilt = "CodeTilt";

            /// <summary>状态</summary>
            public const String Status = "Status";

            /// <summary>日期</summary>
            public const String ProductDate = "ProductDate";
        }
        #endregion
    }
}